package com.gaofei.order.service;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.io.IOException;

import static com.gaofei.order.config.RabbitMQConfig.DEAD_LETTER_QUEUEA_NAME;

/**
 * @author : gaofee
 * @date : 10:43 2021/1/26
 * @码云地址 : https://gitee.com/itgaofee
 */
@Component
public class MsgReceiver {

    @RabbitListener(queues = "msgQueue")
    public void receiveA(Message message, Channel channel) throws IOException {
        System.out.println("收到消息：" + new String(message.getBody()));
    }
}
